//
// sparse1.h
//
// Code generation for function 'sparse1'
//

#pragma once

// Include files
#include "rtwtypes.h"
#include "coder_array.h"
#include "interface/covrt.h"
#include "interface/emlrt.h"
#include "interface/mex.h"
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>

// Type Declarations
namespace coder {
class b_sparse;

}
struct d_struct_T;

// Type Definitions
namespace coder {
class sparse {
public:
  static void assertValidIndexArg(const emlrtStack *sp,
                                  const ::coder::array<int32_T, 1U> &s,
                                  ::coder::array<int32_T, 1U> &sint);
  void ctranspose(const emlrtStack *sp, sparse *y) const;
  void mtimes(const emlrtStack *sp, const sparse *b, sparse *c) const;
  void times(const emlrtStack *sp, real_T a, sparse *s) const;
  void plus(const emlrtStack *sp, const sparse *b, sparse *s) const;
  void inv(const emlrtStack *sp, sparse *y) const;
  static void spallocLike(const emlrtStack *sp, int32_T b_m, real_T b_n,
                          sparse *s);
  void parenReference(const emlrtStack *sp, real_T varargin_2,
                      b_sparse *s) const;
  static void spallocLike(const emlrtStack *sp, int32_T b_m, int32_T nzmax,
                          b_sparse *s);
  void b_minus(const emlrtStack *sp, const sparse *b, sparse *s) const;
  void mtimes(const emlrtStack *sp, const ::coder::array<real_T, 1U> &b,
              ::coder::array<real_T, 1U> &c) const;
  static void permuteVector(const emlrtStack *sp,
                            const ::coder::array<int32_T, 1U> &idx,
                            ::coder::array<int32_T, 1U> &y);
  void fillIn();
  void parenAssign(const emlrtStack *sp, const ::coder::array<real_T, 1U> &rhs,
                   real_T varargin_2);
  static void b_realloc(const emlrtStack *sp, sparse *b_this,
                        int32_T numAllocRequested, int32_T ub1, int32_T lb2,
                        int32_T ub2, int32_T offs);
  static int32_T copyNonzeroValues(const emlrtStack *sp, sparse *b_this,
                                   d_struct_T *rhsIter, int32_T outStart,
                                   const ::coder::array<real_T, 2U> &rhs);
  static void incrColIdx(const emlrtStack *sp, sparse *b_this, int32_T col,
                         int32_T offs);
  static void decrColIdx(const emlrtStack *sp, sparse *b_this, int32_T col,
                         int32_T offs);

private:
  static void allocEqsizeBinop(const emlrtStack *sp, const sparse *a,
                               const sparse *b, int32_T sn, int32_T sm,
                               sparse *s);
  void b_fillIn();
  static void sparseSparseEqHeightBinOp(const emlrtStack *sp, const sparse *a,
                                        const sparse *b, sparse *s);
  static void sparseSparseRowExpandBinOp(const emlrtStack *sp,
                                         const sparse *rowA, const sparse *b,
                                         sparse *s, boolean_T expandB);
  static int32_T copyNonzeroValues(const emlrtStack *sp, sparse *b_this,
                                   d_struct_T *rhsIter, int32_T outStart,
                                   const ::coder::array<real_T, 1U> &rhs);
  static void b_sparseSparseEqHeightBinOp(const emlrtStack *sp, const sparse *a,
                                          const sparse *b, sparse *s);
  static void b_sparseSparseRowExpandBinOp(const emlrtStack *sp,
                                           const sparse *rowA, const sparse *b,
                                           sparse *s, boolean_T expandB);
  static void c_sparseSparseRowExpandBinOp(const emlrtStack *sp,
                                           const sparse *rowA, const sparse *b,
                                           sparse *s);
  static void d_sparseSparseRowExpandBinOp(const emlrtStack *sp,
                                           const sparse *rowA, const sparse *b,
                                           sparse *s);
  static void e_sparseSparseRowExpandBinOp(const emlrtStack *sp,
                                           const sparse *rowA, const sparse *b,
                                           sparse *s);
  static void f_sparseSparseRowExpandBinOp(const emlrtStack *sp,
                                           const sparse *rowA, const sparse *b,
                                           sparse *s);

public:
  array<real_T, 1U> d;
  array<int32_T, 1U> colidx;
  array<int32_T, 1U> rowidx;
  int32_T m;
  int32_T n;
  int32_T maxnz;
};

class b_sparse {
public:
  void full(const emlrtStack *sp, ::coder::array<real_T, 2U> &y) const;
  array<real_T, 1U> d;
  array<int32_T, 1U> colidx;
  array<int32_T, 1U> rowidx;
  int32_T m;
};

} // namespace coder

// End of code generation (sparse1.h)
